home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C / Applications / MacPerl 5.1.3 / Mac_Perl_513_src / MacPerl5 / Demo / InsertUPP < prev    next >
Encoding:
Text File  |  1994-07-09  |  683 b   |  31 lines  |  [TEXT/MPS ]

  1. Perl -Sx "{0}" {"Parameters"}≥≥{Worksheet}; Exit
  2. #!perl
  3.  
  4. ($dir) = ($0 =~ /^(.*):[^:]+$/);
  5.  
  6. dbmopen(UPP, "$dir:UPPDB", 0);
  7.  
  8. exit unless ($file = &MacPerl'Pick("Which File?", sort keys %UPP));
  9. exit unless ($info = &MacPerl'Pick("Which Type?", sort split(",", $UPP{$file})));
  10.  
  11. $info = "upp" . $info . "Info";
  12.  
  13. open(SELECTION, "$ENV{Active}.§") || die "$!";
  14.  
  15. while (<SELECTION>) {
  16.     last if (($proc) = ($_ =~ /(\w+)\(/));
  17. }
  18.  
  19. close(SELECTION);
  20.  
  21. print <<END_UPP;
  22. #if USESROUTINEDESCRIPTORS
  23. RoutineDescriptor    u$proc = 
  24.         BUILD_ROUTINE_DESCRIPTOR($info, $proc);
  25. #else
  26. #define u$proc *(RoutineDescriptor *)&$proc
  27. #endif
  28. END_UPP
  29.  
  30. print STDERR "search /[¬a-zA-Z]$proc[¬a-zA-Z]/ ≈.h ≈.c ≈.cp\n";
  31.